[FORMAT "WCOFF"]
[INSTRSET "i486p"]
[BITS 32]
[FILE "syscall.nas"]

		GLOBAL	_api_syscall

[SECTION .text]

_api_syscall:	; int api_syscall(int edi, int esi, int ebp, int ebx, int edx, int ecx, int eax);
        PUSH    EDI
        PUSH    ESI
        PUSH    EBP
        PUSH    EBX
        PUSH    EDX
        PUSH    ECX
		MOV		EDI,[ESP+28]	    ; edi
		MOV		ESI,[ESP+28+4]	    ; esi
		MOV		EBP,[ESP+28+8]	    ; ebp
		MOV		EBX,[ESP+28+12]	    ; ebx
		MOV		EDX,[ESP+28+16]	    ; edx
        MOV     ECX,[ESP+28+20]     ; ecx
        MOV     EAX,[ESP+28+24]     ; eax        
		INT		0x40
        POP     ECX
        POP     EDX
        POP     EBX
        POP     EBP
        POP     ESI
        POP     EDI
		RET
